using System.Collections;
using UnityEngine;
using VoxelEngine;

namespace VoxelGame.World
{
	public class ParticleFactory : MonoBehaviour
	{
		public IEnumerator Create(ResourceAsset particlesAsset)
		{
			UnityEngine.Debug.Log("[Voxel] Creating Particles");
			ParticlesData particlesData = null;
			yield return StartCoroutine(particlesAsset.AsyncAsset(delegate(ParticlesData asset)
			{
				particlesData = asset;
			}));
			for (int i = 0; i < particlesData.Particle.Length; i++)
			{
				GameObject original = particlesData.Particle[i];
				GameObject gameObject = UnityEngine.Object.Instantiate(original);
				gameObject.transform.SetParent(base.transform);
			}
		}
	}
}
